package com.atguigu.eduorder.utils;


import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author 25169
 */
@Component
public class WeXinUtils implements InitializingBean {
    //读取配置文件内容
    @Value("${appid}")
    private String appid;

    @Value("${partner}")
    private String mchid;

    @Value("${ip}")
    private String spbillcreateip;

    @Value("${notifyurl}")
    private String notifyurl;

    @Value("${trade_type}")
    private String tradetype;

    @Value("${partnerkey}")
    private String partnerkey;


    public static String APPID;
    public static String MCH_ID;
    public static String SPBILL_CREATE_IP;
    public static String NOTIFY_URL;
    public static String TRADE_TYPE;
    public static String PARENTKEY;

    @Override
    public void afterPropertiesSet() throws Exception {
        APPID = appid;
        MCH_ID = mchid;
        SPBILL_CREATE_IP = spbillcreateip;
        NOTIFY_URL = notifyurl;
        TRADE_TYPE = tradetype;
        PARENTKEY=partnerkey;
    }


}
